import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../../routes/app_pages.dart';
import '../../../style/widget_style.dart';

class ConnectingDeviceController extends GetxController {

  @override
  void onInit() {
    super.onInit();
  }

  @override
  void onReady() {
    super.onReady();
    Future.delayed(Duration(seconds: 2), () {
      showpoupWindow();
    });
  }

  @override
  void onClose() {
    super.onClose();
  }

  void showpoupWindow() {
    showModalBottomSheet(
        context: Get.context!,
        builder: (context) => SafeArea(child: Container(
          padding: EdgeInsets.all(20.h),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Text('智译Pro',style: AppStyleThemeData.PAGE_TITLE,),
              SizedBox(height: 17.h,),
              Image.asset('assets/images/product_device1.png',width: 128.w, height: 128.h),
              SizedBox(height: 15.h,),
              Container(
                width: Get.width,
                child: ElevatedButton(
                    onPressed: () {
                      Get.back();
                      Get.toNamed(Routes.HOME);
                    },
                    child: const Text("连接")
                ),
              )
            ],
          ),
        )),
        backgroundColor: Colors.white

    );
  }
}
